<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/login.css">
<link rel="shortcut icon" href="../images/copylogo.png" type="image/x-icon" />
<title>后台登陆</title>
</head>
<body>
	<div id="login_top">
		<div id="welcome">
			欢迎使用源辰个人博客后台管理系统
		</div>
		<div id="back">
			<a href="../index.html">返回首页</a>&nbsp;&nbsp; | &nbsp;&nbsp;
			<a href="#">帮助</a>
		</div>
	</div>
	<div id="login_center">
		<div id="login_area">
			<div id="login_form">
				<form action="index.html" method="post" id="myform">
					<div id="login_tip">
						用户登录&nbsp;&nbsp;UserLogin
					</div>
					<div><input type="text" class="username" id="account" value="yy" placeholder="请输入账号..."></div>
					<div><input type="password" class="pwd" id="pwd" value="123321" placeholder="请输入密码..."></div>
					<div id="btn_area">
						<input type="button"  onclick="checkLogin()" id="sub_btn" value="登&nbsp;&nbsp;录">&nbsp;&nbsp;
					</div>
				</form>
			</div>
		</div>
	</div>
	<div id="login_bottom">
		<label style="color:#FFF"><a class="copy" href="http://www.hyycinfo.com">源辰信息 </a>&copy; 版权所有</label>
	</div>
	
<script type="text/javascript" src="../js/jquery-3.4.1.min.js"></script>
<script type="text/javascript">
function checkLogin() {
	var account = $.trim($("#account").val());
	var pwd = $.trim($("#pwd").val());
	
	if (account == "") {
		alert("请输入账号...");
		return;
	}
	
	if (pwd == "") {
		alert("请输入密码...");
		return;
	}
	
	//发送异步请求
	$.post("../admin",{op:"login", aname:account, pwd:pwd}, data => {
		if(data.code ==200){
			location.href="manager/index.html"; //说明登陆成功，则跳到主界面
		}else{
			alert("账号或密码错误，请确认后重新登陆");
		}
	},"json");
}
</script>
</body>
</html>